package com.examination.system.administrator;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * @author 寇淇芮
 * @Date 2019/8/18 12:08
 */
@SpringBootApplication
@EntityScan("com.examination.system.administration")//扫描实体类
@ComponentScan(basePackages={"com.examination.api"})//扫描接口
@ComponentScan(basePackages={"com.examination.system.administrator"})//扫描本项目下的所有类
@ComponentScan(basePackages = {"com.examination.framework"})//扫描错误接口口
public class MainAdministratorApplication {
    public static void main(String[] args) {
        SpringApplication.run(MainAdministratorApplication.class,args);
    }
    
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate(new OkHttp3ClientHttpRequestFactory());
    }

}
